import Studycodemodel from './studycodemodel';
namespace Alymodel {
  export interface Ists {
    accessKeyId: string;
    accessKeySecret: string;
    expiration: Date;
    securityToken: string;
  }

  export enum PBgender {
    男,
    女,
  }

  export interface PBaddress {
    provinc?: string;
    city?: string;
    area?: string;
  }

  export interface IMagent {
    ID?: number;
    name?: string;
  }

  export interface IMagentkey {
    ID?: number;
    agent_ID?: number;
    key_ID?: number;
    count?: number;
    packegekey?: IMpackegekey;
    user?: IMuser;
    packegeInfo?: string
    packegeName?: string
    prize?: number
  }

  // 根据数据库连表返回结构
  export interface PackageCatebagRelation extends Alymodel.IMpackegekey {
    packege: (Alymodel.IMpackege & {
      course: Alymodel.IMcourse & {
        coursecatebag: (Alymodel.IMcoursecatebag & {
          catebag: Alymodel.IMcatebag
        })[]
      }
    })[]
  }
  export interface GroupedByCatebag {
    cID: number;
    paixu?: number;
    name?: string;
    info?: string;
    banner?: string;
    count?: number;
    pkg: { pID?: number, name?: string }[]
    packages: GroupedByCatebagPackages[];
  }
  export interface GroupedByCatebagPackages {
    ID?: number
    course_ID?: number
    pkg: { pID?: number, name?: string }[]
    name?: string,
    paixu?: number;
  }

  // 根据数据库连表返回结构 整理出代理商课包-课程组
  export interface PackageCatebagMap {
    pID: number | undefined
    cID: number | undefined
    cName: string | undefined
    cInfo: string | undefined
    cBanner: string | undefined
    cPaixu: number | undefined
  }

  export interface CourseGroup extends Alymodel.IMcatebag {
    coursecatebag: Alymodel.IMcoursecatebag[]
  }

  export interface IMcatebag {
    ID?: number;
    paixu?: number;
    banner?: string;
    name?: string;
    info?: string;
    updatetime?: Date;
    createtime?: Date;
    count?: number;
    number?: number;
    catebagid?: number;
    typeid?: number;
  }

  export interface IMcatebagtype {
    ID?: number;
    name?: string;
    info?: string;
    paixu?: number;
  }

  export interface IMconstvalue {
    ID?: number;
    key?: string;
    value?: JSON;
    time?: Date;
  }

  export interface IMcoursecatebag {
    ID?: number;
    cid?: number;
    catebagid?: number;
    paixu?: number
    updatedAt?: Date
    createdAt?: Date
  }

  export interface IMpassword {
    ID?: string;
    state?: number;
    passwordgroupid?: number;
    uid?: number;
    created_at?: Date;
    updated_at?: Date;
  }

  export interface IMpasswordgroup {
    ID?: number;
    name?: string;
    info?: string;
    starttime?: Date;
    endtime?: Date;
    created_at?: Date;
    updated_at?: Date;
  }

  export interface IMremarks {
    ID?: number;
    uid?: number;
    username?: string;
    content?: string;
    userID?: number;
    created_at?: Date;
  }

  export interface IMreply {
    ID?: number;
    content?: string;
    topicid?: number;
    uid?: number;
    username?: string;
    headimg?: string;
    replyid?: number;
    created_at?: Date;
    updated_at?: Date;
  }

  export interface IMsecretfile {
    ID?: number;
    fileurl?: string;
    TgtUri?: string;
    name?: string;
    imageurl?: string;
    type?: 'PDF' | 'PPT';
    watch?: 'User' | 'Tecaher' | 'Agent' | 'Student' | 'Admin';
    info?: string;
    tag?: string;
    paixu?: number;
    created_at?: Date;
    updated_at?: Date;
  }

  export interface IMshare {
    ID?: number;
    name?: string;
    info?: string;
    imageurl?: string;
    headimg?: string;
    videourl?: string;
    watch?: number;
    uid?: number;
    examine?: number;
    createAt?: Date;
    comments?: number;
    fabulous?: number;
    username?: string;
  }

  export interface IMsharecomment {
    ID?: number;
    info?: string;
    uid?: number;
    shareid?: number;
    paterid?: number;
    createAt?: Date;
    fabulous?: number;
    username?: string;
    headimg?: string;
  }

  export interface IMsharecommentfabulous {
    ID?: number;
    uid?: number;
    sharecommentid?: number;
  }

  export interface IMsharefabulous {
    ID?: number;
    uid?: number;
    shareid?: number;
  }

  export interface IMteachercoursefile {
    ID?: number;
    info?: JSON;
    fileurl?: string;
    courseid?: number;
    imgurl?: string;
    uploaduserid?: number;
    createtime?: Date;
    updatetime?: Date;
  }

  export interface IMteacherproposal {
    ID?: number;
    name?: string;
    info?: string;
    paixu?: number;
    pid?: number;
    tag?: string;
    created_at?: Date;
    updated_at?: Date;
  }

  export interface IMteachertextitembank {
    ID?: number;
    name?: string;
    info?: string;
    uid?: number;
    createdAt?: Date;
    updatedAt?: Date;
    data?: any[];
  }

  export interface IMtestanswer {
    ID?: number;
    teachertextitembankid?: number;
    openid?: string;
    info: string;
    data?: string[];
    phonenum?: string;
    created_at?: Date;
    updated_at?: Date;
    name?: string;
  }

  export interface IMtopic {
    ID?: number;
    title?: string;
    type?: string;
    txt?: string;
    uid?: number;
    username?: string;
    headimg?: string;
    fabulous?: number;
    top?: boolean;
    good?: boolean;
    lock?: boolean;
    reply_count?: number;
    collect_count?: number;
    click_count?: number;
    last_reply?: number;
    content_is_html?: boolean;
    contenturl?: string;
    last_reply_at?: Date;
    createdAt?: Date;
    updatedAt?: Date;
  }

  export interface IMtopiccollect {
    ID?: number;
    uid?: number;
    topicid?: number;
  }

  export interface IMtpdata {
    ID?: number;
    fileurl?: string;
    name?: string;
    teacherproposalid?: number;
    isdown?: boolean;
    tablename?: string;
    tableid?: number;
    paixu?: number;
    types?: string;
    created_at?: Date;
    updated_at?: Date;
  }

  export interface IMtrade {
    ID?: number;
    autoIncrement?: boolean;
    statue?: string;
    appid?: string;
    total_amount?: number;
    subject?: string;
    updatedAt?: Date;
  }

  export interface IMuserguide {
    ID: number;
    uid?: number;
    guideid?: number;
    created_at?: Date;
  }

  export interface IMusernotice {
    ID?: number;
    issee?: boolean;
    userid?: number;
    noticeid?: number;
    name?: string;
  }

  export interface IMuserrecord {
    ID?: number;
    tablename?: 'topic' | 'reply';
    uid?: number;
    tableid?: number;
  }

  export interface IMusertotpdata {
    ID?: number;
    uid?: number;
    tpdata_ID?: number;
  }

  export interface IMvideo {
    ID?: number;
    videoid?: string;
  }

  export interface IMvideoanswers {
    ID?: number;
    videoid: string;
    title: string;
    info?: string;
    paixu?: number;
    createdAt?: Date;
    updatedAt?: Date;
  }

  export interface IMvideoquestion {
    ID?: number;
    time?: number;
    questionType?: 'singleChoice' | 'multipleChoic';
    questionData?: object;
    mark?: number;
    picture?: string;
    video_ID?: number;
    answer?: string;
    questionStartTime?: number;
  }

  export interface IMwechattemp {
    ID?: number;
    temp?: string;
    name?: string;
  }

  export interface IMwhitepoint {
    ID?: number;
    miaoshu?: string;
    videoid?: number;
    info?: string;
    data?: object;
    starttime?: number;
    creattime?: Date;
    updatetime?: Date;
    totaltime?: number;
  }

  export interface IMcourseforum {
    ID?: number;
    userid?: number;
    context?: string;
    courseid?: number;
    username?: string;
    headimage?: string;
    courseforumid?: number;
    createdAt?: Date;
    state?: number
    examine?: string
    top?: number
    rejectreason?: string
    course?: IMcourse
  }

  export interface IMpackegekey {
    ID?: number;
    prize?: number;
    packegeName?: string;
    packegeInfo?: string;
    createdAt?: Date;
    updatedAt?: Date;
    packege?: IMpackege[];
  }

  export interface IMpackege {
    ID?: number;
    course_ID?: number;
    key_ID?: number;
    packegekey?: IMagentkey;
    createdAt?: Date;
    course?: IMcourse;
  }

  export interface IMuser extends Studycodemodel.Iuser {
    teamids?: string;
    ID?: number;
    userid?: number;
    info?: string;
    password?: string;
    usertype?: string;
    username?: string;
    useremail?: string;
    phonenum?: string;
    level?: number;
    experience?: number;
    headimg?: string;
    medal?: number;
    lastlogintime?: Date;
    totalspend?: number;
    agent?: number;
    packegeid?: number;
    area?: string;
    openid?: string;
    point?: number;
    updatepointtime?: Date;
    stuid?: string;
    cardid?: string;
    thitinfo?: object;
    createdAt?: Date;
    accessToken?: string;
    unionid?: string;
    xingming?: string;
    qq?: string;
    birthday?: Date;
    gender?: PBgender;
    address?: PBaddress;
    isnetwork?: boolean;
  }


  export enum PBlevel {
    level1,
    level2,
    level3,
    level4,
    level5,
    level6,
    level7,
  }

  export interface IMcourse {
    ID?: number;
    coursePrize?: number;
    info?: string;
    introduction?: string;
    banner?: string;
    name?: string;
    environment?: string;
    level?: PBlevel;
    courseType?: string;
    courseTag?: string;
    difficulty?: number;
    paixu?: number;
    hot?: number;
    iframeid?: number;
    createdAt?: Date;
    updatedAt?: Date;
    lession?: IMlession[];
    coursecoursesection?: IMcoursecoursesection[]
  }


  export interface IMcoursecatebag {
    ID?: number;
    cid?: number;
    catebagid?: number;
    course?: IMcourse;
  }

  export interface IMusercourse {
    ID?: number;
    lessionNum?: number;
    permission?: number;
    otherInfo?: string;
    user_ID?: number;
    course_ID?: number;
    createTime?: Date;
    trade_ID?: number;
    collect?: boolean;
    updateTime?: Date;
  }

  export interface Ivideoquestion {
    ID?: number;
    time?: number;
    questionType?: 'singleChoice' | 'multipleChoic';
    questionData?: object;
    mark?: number;
    picture?: string;
    video_ID?: number;
    answer?: string;
    questionStartTime?: number;
  }

  export interface Ifileurl {
    ID?: number;
    file_URL?: string;
    course_ID?: number;
    img_URL?: string;
    action_URL?: string;
    system?: 'windows' | 'mac';
    arch?: '64' | '32';
    name?: string;
  }

  export interface Iteachercoursefile {
    ID?: number;
    info?: JSON;
    fileurl?: string;
    courseID?: number;
    imgurl?: string;
    uploaduserid?: number;
    createdAt?: Date;
    updatedAt?: Date;
  }

  export interface Iwhitepoint {
    ID?: number;
    miaoshu?: string;
    videoid?: number;
    info?: string;
    data?: object;
    starttime?: number;
    createdAt?: Date;
    updatedAt?: Date;
    totaltime?: number;
  }

  export interface IMcoursepasswordgroup {
    ID?: number;
    cid?: number;
    passwordgroupid?: number;
    created_at?: Date;
    updated_at?: Date;
  }

  export interface IMfileurl {
    ID?: number;
    course_ID?: number;
    key_ID?: number;
    file_URL?: string;
    img_URL?: string;
    action_URL?: string;
    system?: string;
    arch?: string;
    name?: string;
  }

  export interface IMiframe {
    ID?: number;
    name?: string | null;
    url?: string | null;
    option?: JSON | null;
  }

  export interface IMitembank {
    ID?: number;
    itembankgroupid?: number;
    text?: string;
    data?: JSON;
    type?: '单选' | '多选' | '填空' | '解答';
    tags?: string;
    name?: string;
    username?: string;
    knowledgepoints?: string;
    analysis?: string;
    createdAt?: Date;
    updatedAt?: Date;
  }

  export interface IMitembankgroup {
    ID?: number;
    name?: string;
    createdAt?: Date;
    updatedAt?: Date;
  }

  export interface IMlession {
    ID?: number;
    num?: number | null;
    course_ID?: number;
    videoId?: string | null;
    lessionName?: string | null;
    lessionCreateTime?: Date | null;
    lessionUpdateTime?: Date | null;
    lessionInfo?: string | null;
    videoCover?: string | null;
    type?: 'video' | 'vector' | 'question';
    secretfileID?: number;
    questionid?: number
  }

  export interface IMnotice {
    ID?: number;
    url?: string | null;
    type?: string | null;
    name?: string | null;
    created_at?: Date | null;
  }

  export interface IMcoursesection {
    ID?: number
    name?: string
    videoid?: string
    createdAt?: Date
    updatedAt?: Date
    info?: string
    secretfileid?: string
    questionid?: string
    type?: 'video' | 'vector' | 'question' | 'interaction';
    videoCover?: string
    audiourl?: string
    md?: string
  }

  export interface IMcoursecoursesection {
    ID?: number
    courseid?: number
    coursesectionid?: number
    createdAt?: Date
    paixu?: number
    coursesection?: IMcoursesection
    course?: IMcourse
  }
}

export default Alymodel;
